const resultEnum = require('../utils/resultEnum').ResultEnum;
const Mock = new(require('../utils/mock')).Mocks();

/* 查询预展类型信息 */
function selectAuctionProductTypeInfo(ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);
    ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getAuctionProductTypeInfo())
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}
/* 查询预展信息 */
function selectSpecialProductInfo(ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);
    ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getSpecialProductInfo())
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}

/* 修改准备状态信息 */
function putReadyInfo(ctx, next) {
  try {
    const params = {
      ...ctx.request.body,
      ...ctx.params
    };
    console.log(params);
    ctx.success(resultEnum.UPDATE_SUCCESS.code, resultEnum.UPDATE_SUCCESS.msg)
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}
/* 获取拍卖专场信息 */
function putSignUpInfo(ctx, next) {
  try {
    const params = {
      ...ctx.request.body,
      ...ctx.params
    };
    console.log(params);
    ctx.success(resultEnum.UPDATE_SUCCESS.code, resultEnum.UPDATE_SUCCESS.msg)
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}
/* 修改专场收藏状态信息 */
function putCollectInfo(ctx, next) {
  try {
    const params = {
      ...ctx.request.body,
      ...ctx.params
    };
    console.log(params);
    ctx.success(resultEnum.UPDATE_SUCCESS.code, resultEnum.UPDATE_SUCCESS.msg)
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}

module.exports = {
  selectAuctionProductTypeInfo,
  selectSpecialProductInfo,
  putReadyInfo,
  putSignUpInfo,
  putCollectInfo
}